import { http } from '@/utils/http'
// src/services/home.ts
import type { GoodsItem } from '@/types/global'

// GuessItem 和 GoodsItem 类型相同
export type GuessItem = GoodsItem
import type { BannerItem, CategoryItem, GuessItem, HotItem } from '@/types/home'
import type { PageParams, PageResult } from '@/types/global'
export const getHomeBanner = (distributionSite = 1) => {
  return http<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}
// 首页分类
export const getHomeCategory = () => {
  return http<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}
// 推荐
export const getHomeHot = () => {
  return http<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}

export const getHome = (userId:any) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: `/user/user/recordInfo/${userId}`,
    data:userId
  })
}


// 查询用户绑定的设备信息
export const getUserDeviceData = (userId:any)=>{
	return http<PageResult<GuessItem>>({
	  method: 'GET',
	  url: `/user/user/userDeviceBind/${userId}`,
	  data:userId
	})
}
// 用户查看医生对测量数据的建议
export const getDoctorData = (recordOriginalId) =>{
  return http({
    method:'GET',
    url:`/user/user/getDoctorAdvice/${recordOriginalId}`,
    recordOriginalId
  })
}
